package com.lanxiao.cloud.modules.file.application;

import com.lanxiao.cloud.modules.file.application.assembler.FileConfigureAssembler;
import com.lanxiao.cloud.modules.file.application.dto.FileConfigureCmdUpdate;
import com.lanxiao.cloud.modules.file.domain.service.IFileConfigureService;
import org.springframework.stereotype.Component;

/**
 * @author ：qiaoliang
 * @date ：2021-10-25
 */
@Component
public class FileConfigureCmdManager {

  private final IFileConfigureService fileConfigureService;
  private final FileConfigureAssembler fileConfigureAssembler;

  public FileConfigureCmdManager(
      IFileConfigureService fileConfigureService,
      FileConfigureAssembler fileConfigureAssembler) {
    this.fileConfigureService = fileConfigureService;
    this.fileConfigureAssembler = fileConfigureAssembler;
  }

  /**
   *  修改上传配置
   *
   * @author ：qiaoliang
   * @param id : 配置ID
   * @param update : 配置信息
   * @return void
   * @date 2021-10-25 14:49
   */
  public void updateFileConfigure(Long id, FileConfigureCmdUpdate update) {
    fileConfigureService.updateFileConfigure(fileConfigureAssembler.toFileConfigure(id, update));
  }

}
